import org.csource.fastdfs.*;

public class FastDFS {
    public static void main(String[] args) throws Exception {
        //1、加载配置文件
        ClientGlobal.init("E:/IdeaProjects/pinyougouparent/fastDFSDemo/src/main/resources/fdfs_client.conf");
        //2、创建TrackerClient对象
        TrackerClient trackerClient = new TrackerClient();
        //3、使用trackerClient创建连接，获得TrackerServer对象
        TrackerServer trackerServer = trackerClient.getConnection();
        //4、创建一个StorageServer引用
        StorageServer storageServer = null;
        //5、创建StorageClient对象
        StorageClient storageClient = new StorageClient(trackerServer,storageServer);
        //6、使用storageClient对象上传图片
        String[] strings = storageClient.upload_file("F:/1366x768/144185155782.jpg", "jpg", null);
        //7、返回数组：
        for (String string : strings) {
            System.out.println(string);
        }
        /*
        group1
        M00/00/00/wKgZhV0q6eKAckIlAAjrbZOJqoo231.jpg
        http://192.168.25.133/group1/M00/00/00/wKgZhV0q6eKAckIlAAjrbZOJqoo231.jpg
       */
    }
}
